Skip to content

feat: add explicit ToplingDB runtime selection - #3275

Merged
imbajin merged 15 commits into
apache:masterfrom
hugegraph:task/topling-core-20261005
Oct 8, 2026
Merged

imbajin merged 15 commits into
apache:masterfrom
hugegraph:task/topling-core-20261005

Conversation

@imbajin

@imbajin imbajin commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Purpose of the PR

Make ToplingDB an optional storage engine while preserving HugeGraph APIs. Standard RocksDB remains the default.

How to switch

Switch RocksDB to ToplingDB

  1. Run bash bin/prepare-topling.sh following the setup guide.
  2. Set rocksdb.provider=topling in the standalone graph properties and export TOPLINGDB_ROCKSDB_PROVIDER=topling.
  3. Initialize the fresh graph with bash bin/init-store.sh, then run bash bin/start-hugegraph.sh.

PD and Store use their own configuration and start scripts. ToplingDB offers performance-focused storage and flexible configuration.

Original preparation reference Original preparation reference

Main Changes

  • Prepare and select a component-local ToplingDB runtime before startup.
  • Preserve cache lifetime and release request, native and service resources.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Covered by existing tests and focused regression tests.
  • Java 17 compilation and installation with Maven 3.10; relevant runtime and lifecycle checks.

Current CI results are shown in the checks below.

Does this PR potentially affect the following parts?

  • Dependencies
  • Modify configurations
  • The public API
  • Other affects: optional native runtime and resource lifecycle
  • Nope

Documentation Status

  • Doc - TODO
  • Doc - Done: repository guide and website PR #510; coordinate both merges.
  • Doc - No Need

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.09970% with 142 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.29%. Comparing base (af3c686) to head (96f99de).

Files with missing lines Patch % Lines
...a/org/apache/hugegraph/store/HeartbeatService.java 55.73% 23 Missing and 4 partials ⚠️
...gegraph/backend/store/rocksdb/RocksDBSessions.java 4.54% 21 Missing ⚠️
.../hugegraph/backend/store/rocksdb/RocksDBStore.java 36.36% 20 Missing and 1 partial ⚠️
...he/hugegraph/backend/tx/GraphIndexTransaction.java 45.00% 7 Missing and 4 partials ⚠️
...a/org/apache/hugegraph/pd/TaskScheduleService.java 0.00% 9 Missing ⚠️
.../org/apache/hugegraph/pd/meta/MetadataFactory.java 58.82% 6 Missing and 1 partial ⚠️
...rc/main/java/org/apache/hugegraph/HugeFactory.java 61.11% 6 Missing and 1 partial ⚠️
...graph/backend/cache/CachedSchemaTransactionV2.java 77.41% 2 Missing and 5 partials ⚠️
...ugegraph/backend/cache/CachedGraphTransaction.java 70.00% 3 Missing and 3 partials ⚠️
...raph/backend/store/rocksdb/RocksDBStdSessions.java 54.54% 5 Missing ⚠️
... and 9 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3275      +/-   ##
============================================
+ Coverage     40.46%   41.29%   +0.83%     
- Complexity     6566     6815     +249     
============================================
  Files           751      766      +15     
  Lines         63982    66317    +2335     
  Branches       8502     8806     +304     
============================================
+ Hits          25889    27386    +1497     
- Misses        35175    35857     +682     
- Partials       2918     3074     +156     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@imbajin
imbajin force-pushed the task/topling-core-20261005 branch from 40994eb to 7ee8766 Compare October 6, 2026 10:26
MrJs133
MrJs133 previously approved these changes Oct 6, 2026

@bitflicker64 bitflicker64 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: yes. Summary: The new current-schema lookup in GraphIndexTransaction throws for vertices and edges whose label was deleted. Those left records can no longer be dropped, and a normal vertex with a left edge can no longer be dropped either. Both deletes worked before this PR. I found nothing else actionable in the launcher selection, the RocksDB provider check, the Topling truncate path, the cache lifetime change or the PD/Store shutdown rework. CI on this head is red, and both failures look unrelated: RateLimiterTest timing in server_memory, and dependency-review flagging the existing netty-handler 4.1.52 in hg-pd-dist. Evidence: static trace of StandardHugeGraph.vertexLabelOrNone/edgeLabelOrNone -> VertexLabel/EdgeLabel.undefined(graph, id); SchemaTransaction.getVertexLabel/getEdgeLabel return null for a missing id; GraphTransaction.removeVertex and prepareDeletions -> updateVertexIndex/updateEdgeIndex -> GraphIndexTransaction.indexLabelIds -> currentSchemaLabel E.checkArgument; GraphTransaction.warnLeftRecord shows these records are returned to callers.

imbajin added 15 commits October 8, 2026 20:31
- align Netty, gRPC and protobuf runtime versions
- preserve module dependency and test configuration
- include packaged dependencies and matching licenses
- add explicit provider selection and compatibility checks
- preserve standard RocksDB as the default
- cover runtime selection and utility scanning
- verify the JNI package and EasyMigrate capability
- install readable runtime assets outside standard libraries
- provide shared preload selection and native configuration
- select one runtime for Server, init and dump commands
- keep inherited configuration scoped to the selected component
- cover launcher selection and upgrade contracts
- close session and database native resources reliably
- preserve commits and clear reusable write batches
- cover native session disposal and reuse
- retain shared caches and invalidation listeners across requests
- dispose graph-scoped holders when the graph closes
- protect reopened graphs from stale transaction leases
- release backend leases at request and task completion
- preserve committed work and roll back unfinished writes
- cover authentication and graph transaction cleanup
- retain nullable and label semantics across cleanup
- refresh graph index schema identities consistently
- cover vertex, edge and index operations
- coordinate scheduled services and Raft shutdown
- release metadata and native database owners
- cover PD lifecycle cleanup
- ship shared runtime helpers in PD and Store distributions
- match native selection with component provider settings
- preserve Store caller preloads across allocator paths
- drain heartbeat work before releasing Store owners
- close partition and metric native resources
- cover heartbeat and metric session cleanup
- close node services through the component lifecycle
- avoid shutdown from locked state callbacks
- preserve coordinated invalid-shard exit handling
- start the first reset after the configured interval
- preserve the initial request window
- cover fixed-window timing boundaries
- keep launcher regressions in the PD and Store workflow
- align the PR merge fixture with the actual event SHA
- use canonical ASF project references
- show prepare, configure, initialize and start in order
- keep persistent paths and distributed component settings clear
- use the approved illustration and a single README entry
@imbajin
imbajin force-pushed the task/topling-core-20261005 branch 2 times, most recently from 22bff97 to 96f99de Compare October 8, 2026 13:31
@imbajin
imbajin merged commit 134300a into apache:master Oct 8, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants